package com.iwhalecloud.bss.kite.cucc.service.attr.handler;

import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.common.constant.LocalKeyConsts;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;
import com.ztesoft.bss.common.util.ContextUtil;

public class CarryingNetAttrHandler extends AbstractAttrHandler {

    @Override
    public void after(KiteAttr attr, KiteInst inst, AttrData data) {
        //河南个性化 【【承载网络】包含选择项OLT(100006949)、城域网(1_0000398)、SDH(1_0000352),非河南去掉，默认包含
        String provinceCode = ContextUtil.getLoginInfo().getUserInfo().getPostProvinceNbr();
        if(!LocalKeyConsts.PROVINCE_HENAN.equals(provinceCode)){
            attr.getAttrValues().removeIf(targetAttr -> KiteStringUtils.equals(targetAttr.getAttrValue(), "100006949"));
            attr.getAttrValues().removeIf(targetAttr -> KiteStringUtils.equals(targetAttr.getAttrValue(), "1_0000398"));
            attr.getAttrValues().removeIf(targetAttr -> KiteStringUtils.equals(targetAttr.getAttrValue(), "1_0000352"));
        }
        super.after(attr, inst, data);
    }
}
